#include "bits/stdc++.h"

using namespace std;

int countGoodSubstrings(string s)
{
    int res = 0;
    for (int i = 0; i <= s.size() - 3; i ++) {
        if (s[i] != s[i+1] && s[i+1] != s[i+2] && s[i]!=s[i+2])
            res++;
    }
    return res;
}

int main()
{
    string s;
    cin >> s;
    cout << countGoodSubstrings(s) << endl;
    return 0;
}